<script setup>
import {computed, ref, watchEffect} from 'vue'
const props = defineProps({
    total: Number,
    count: Number
})
const emit = defineEmits(['complete'])
const percent = computed(() => {
    if(props.total <= props.count) emit('complete');
    return (props.count / props.total * 100 | 0) + '%'
})
</script>

<template>
    <div class="c-webrtc-progress">
        <div>
            <div class="c-webrtc-progress-track" :style="{width:percent}"></div>
        </div>
        <div class="c-webrtc-progress-count">{{ percent }}</div>
    </div>
</template>